package cn.seaboot.openapi;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.Map;

/**
 * 系统APP文件 [t_sys_app_info] - Controller
 * <p>
 *
 * @author Mr.css on 2018-06-20.
 * @version 1.0.0
 */
@Controller
@RequestMapping("sys/app")
@Tag(name = "系统APP文件 [t_sys_app_info] 管理")
public class AppInfoCtrl {

    /**
     * 增
     *
     * @param pojo pojo
     * @return affected rows
     */
    @ResponseBody
    @Operation(description = "系统APP文件 [t_sys_app_info] 增")
    @RequestMapping(value = "info", method = RequestMethod.POST)
    public int saveInfo(@Validated AppInfo pojo,
                        @RequestParam(required = false) MultipartFile file) throws IOException {
        return 0;
    }

    /**
     * 删
     *
     * @param id id
     * @return affected rows
     */
    @ResponseBody
    @Operation(description = "系统APP文件 [t_sys_app_info] 删")
    @RequestMapping(value = "info", method = RequestMethod.DELETE)
    public int deleteInfo(String id) {
        return 0;
    }

    /**
     * 查
     *
     * @param id id
     * @return pojo
     */
    @ResponseBody
    @Operation(description = "系统APP文件 [t_sys_app_info] 查")
    @RequestMapping(value = "info", method = RequestMethod.GET)
    public AppInfo queryById(String id) {
        return null;
    }

    /**
     * 改
     *
     * @param pojo pojo
     * @return affected rows
     */
    @ResponseBody
    @Operation(description = "系统APP文件 [t_sys_app_info] 改")
    @RequestMapping(value = "info", method = RequestMethod.PUT)
    public int updateInfo(@Validated AppInfo pojo, String id,
                          @RequestParam(required = false) MultipartFile file) throws IOException {
        return 0;
    }

    /**
     * 查列表
     *
     * @param params 参数
     * @return PageInfo
     */
    @ResponseBody
    @Operation(description = "系统APP文件 [t_sys_app_info] 列表查询")
    @Parameters({
            @Parameter(name = "page", description = "页号"),
            @Parameter(name = "limit", description = "行数")})
    @RequestMapping(value = "page", method = RequestMethod.GET)
    public Object queryPage(@RequestParam Map<String, Object> params) {
        return null;
    }
}
